package by.amakarevich.datamodel;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.MapsId;
import javax.persistence.OneToOne;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Entity
public class Kit implements Serializable {
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	
	@Column
	@NotNull
	@Size(max=200)
	private String name;
	
	@Column
	@NotNull
	@Max(value=3000)
	private Long height;
	
	@Column
	@NotNull
	@Max(value=3000)
	private Long width;
	
	@Column
	@NotNull
	@Max(value=100)
	private Long canvas;
	
	@Column
	@NotNull
	@Size(max=20)
	private String kitColor;
	
	@Column
	@Size(max=10000)
	private String specification;
	
	@MapsId
	@OneToOne(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
	@JoinColumn(updatable = false, name = "product_id")
	private Product product;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Long getHeight() {
		return height;
	}
	public void setHeight(Long height) {
		this.height = height;
	}
	public Long getWidth() {
		return width;
	}
	public void setWidth(Long width) {
		this.width = width;
	}
	public Long getCanvas() {
		return canvas;
	}
	public void setCanvas(Long canvas) {
		this.canvas = canvas;
	}
	public String getKitColor() {
		return kitColor;
	}
	public void setKitColor(String kitColor) {
		this.kitColor = kitColor;
	}
	public String getSpecification() {
		return specification;
	}
	public void setSpecification(String specification) {
		this.specification = specification;
	}
	public Product getProduct() {
		return product;
	}
	public void setProduct(Product product) {
		this.product = product;
	}
	
}
